<!DOCTYPE html>
<html>
{include file='/common/_meta'}
<body>
	<!-- 头部 -->
{include file='/common/top'}
	<!-- /头部 -->
	
	<div class="main-container container-fluid">
		<div class="page-container">
			            <!-- Page Sidebar -->
                {include file='/common/left'}
            <!-- /Page Sidebar -->
            <!-- Page Content -->
            <div class="page-content">
                <!-- Page Breadcrumb -->
                <div class="page-breadcrumbs">
                    <ul class="breadcrumb">
                        <li>
                            <a href="{:url('Index/index')}">系统</a>
                        </li>
                        <li class="active">图片管理</li>
                    </ul>
                </div>
                <!-- /Page Breadcrumb -->

                <!-- Page Body -->
                <div class="page-body">
                    
<button type="button" tooltip="添加用户" class="btn btn-sm btn-azure btn-addon" onClick="javascript:window.location.href = '{:url('arti/add')}'"> <i class="fa fa-plus"></i> 添加图片
</button>
<div class="row">
    <div class="col-lg-12 col-sm-12 col-xs-12">
        <div class="widget">
            <div class="widget-body">
                <div class="flip-scroll">
                    <table class="table table-bordered table-hover">
                        <thead class="">
                            <tr styl>
                                <th class="text-center" >图片</th>
                                <th class="text-center" width="12%">操作</th>
                            </tr>
                        </thead>
                        <tbody>
                                {volist name="imglist" id="haha"}
                                <tr>
                                    <td><img height="50" src="{$haha}">
                                    </td>
                                  <td align="center">
                                    <a href="#" onclick=" return delimg(this)" id="{$haha}" class="btn btn-danger btn-sm shiny">
                                        <i class="fa fa-trash-o"></i> 删除
                                    </a>
                                </td>
                            </tr>
                                 {/volist}
                       </tbody>
                   </table>
                        <script>
                            function delimg(i){
                                // if ( !confirm('确定删除吗？')){
                                //     return false;
                                // }
                                var url = "{:url('delimg')}";
                                var imgscr = $(i).attr('id');
                                $.ajax({
                                    url : url,
                                    type : "post",
                                    dataType:"json",
                                    data: {imgscr:imgscr},
                                    success : function(data){
                                        if ( data == 1 ){
                                            $(i).parent().parent().remove();
                                            alert('删除成功');
                                        }else if( data == 2){
                                            alert('删除失败');
                                        }else{
                                            alert('图片不存在');
                                        }
                                    }
                                });

                            }
                            
                        </script>
                </div>
                <div> 
              	</div>
            </div>
        </div>
    </div>
</div>
                </div>
                <!-- /Page Body -->
            </div>
            <!-- /Page Content -->
		</div>	
	</div>

	    <!--Basic Scripts-->
    {include file='/common/footer'}    


</body></html>